import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:convert';

part 'my_expose_response.freezed.dart';
part 'my_expose_response.g.dart';

@freezed
class MyExposeResponse with _$MyExposeResponse {
  const factory MyExposeResponse({
    @JsonKey(name: "c") required int c,
    @JsonKey(name: "m") required String m,
    @JsonKey(name: "d") required D d,
  }) = _MyExposeResponse;

  factory MyExposeResponse.fromJson(Map<String, dynamic> json) =>
      _$MyExposeResponseFromJson(json);
}

@freezed
class D with _$D {
  const factory D({
    @JsonKey(name: "count") required int count,
    @JsonKey(name: "list") required List<ListElement> list,
  }) = _D;

  factory D.fromJson(Map<String, dynamic> json) => _$DFromJson(json);
}

@freezed
class ListElement with _$ListElement {
  const factory ListElement({
    @JsonKey(name: "id") required String id,
    @JsonKey(name: "type") required String type,
    @JsonKey(name: "content") required String content,
    @JsonKey(name: "images") required List<dynamic> images,
    @JsonKey(name: "videos") required List<dynamic> videos,
    @JsonKey(name: "time") required String time,
    @JsonKey(name: "status") required String status,
    @JsonKey(name: "memo") required String memo,
    @JsonKey(name: "is_reply") required bool isReply,
  }) = _ListElement;

  factory ListElement.fromJson(Map<String, dynamic> json) =>
      _$ListElementFromJson(json);
}
